﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Members.ascx.cs" Inherits="controls_admin_Members" %>
<!-- table -->
<script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
    var j = jQuery.noConflict();
    var index = "";
    function getCheck() {
        j("table input[type=checkbox].item").each(function () {
            var checked = j(this).attr("checked");
            if (checked) {
                index = index + j(this).attr("value") + ";";
            }
        });
        j("#<%=hdfCheck.ClientID%>").val(index);
    }
    j(document).ready(function () {
        j("#<%=btnDel.ClientID%>").click(function () {
            getCheck();
            if (index == "") return false;
            else return confirm("Xác nhận xóa !");
        });
    });
</script>
<asp:HiddenField ID="hdfCheck" runat="server" />
<div class="box">
    <!-- box / title -->
    <div class="title">
        <h5>
            Danh sách thành viên</h5>
        <div class="search">
            <div class="input">
                <asp:TextBox ID="txtKeyword" runat="server" Width="200px" />
            </div>
            <div class="button">
                <asp:Button ID="btnSearch" runat="server" Text="Tìm Kiếm" OnClick="btnSearch_Click" />
            </div>
        </div>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <!-- end box / title -->
    <div class="table">
        <table>
            <thead>
                <tr>
                    <th>
                        Mã khách hàng
                    </th>
                    <th>
                        Tên đăng nhập
                    </th>
                    <th>
                        Số điện thoại
                    </th>
                    <th>
                        Ngày đăng ký
                    </th>
                    <th>
                        Vip
                    </th>
                    <th>
                        Tình trạng
                    </th>
                    <%-- <th>
                        Sửa
                    </th>--%>
                    <th class="selected last">
                        <input type="checkbox" class="checkall" />
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptMember" runat="server" OnItemCommand="rptMember_ItemCommand"
                    OnItemDataBound="rptMember_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <%#Eval("MEMBER_CODE")%>
                            </td>
                            <td align="center">
                                <%#Eval("USER_NAME")%>
                                <asp:HiddenField ID="hdfID" runat="server" Value='<%#Eval("MEMBER_ID")%>' />
                            </td>
                            <td align="center">
                                <%#Eval("MOBILE")%>
                            </td>
                            <td align="center">
                                <%#LibraryO2S.O2S_DateTime.dd_MM_yyyy(Convert.ToDateTime(Eval("CREATED_DATE")))%>
                            </td>
                            <td align="center">
                                <asp:Button runat="server" ID="btnVip" CssClass="" CommandName="vip" CommandArgument='<%#Eval("IS_VIP")%>'
                                    BackColor="Transparent" BorderStyle="None" ToolTip='<%#"Vip" + Eval("USER_NAME").ToString()%>' />
                            </td>
                            <td align="center">
                                <asp:Button runat="server" ID="btnactive" CssClass="" CommandName="active" CommandArgument='<%#Eval("IS_ACTIVE")%>'
                                    BackColor="Transparent" BorderStyle="None" ToolTip='<%#"Kích hoạt" + Eval("USER_NAME").ToString()%>' />
                            </td>
                            <%--   <td align="center">
                                <a href='<%#"default.aspx?module=membersedit&mid="+Eval("MEMBER_ID") %>' title="Sửa">
                                    <img src="../Resources/icons/16x16/edit.png" alt='Sửa' class="icon-32-edit" />
                                </a>
                            </td>--%>
                            <td align="center" class="last">
                                <input type="checkbox" value='<%#Eval("MEMBER_ID")%>' class="item" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
        <div class="pagination pagination-left last">
            <div class="pagerContainer" id="pagerContainer" runat="server">
            </div>
        </div>
        <div class="action">
            <div class="button">
                <asp:Button ID="btnDel" runat="server" Text="Xóa" OnClick="btnDel_Click" />
            </div>
        </div>
    </div>
</div>
